'      BASIC Anywhere Machine test program for the PCOPY statement
'      Page 0 is always the active screen and always the one displayed
'      All commands to print text and to draw graphics work only on the
'      active screen
'      Pages 1 and 2 are the only other pages.
'
'      Syntax:  PCOPY (x1,y1) - (x2,y2), source_page, destination_page
'      Or, for full page copy:   PCOPY source_page, destination_page
'      ------------------------------------------------------------—       

CONST 📄active = 0, 📄temp = 1

CONST screen_height = 228, screen_width = 5 * 228

' 🟠🟠🟠 Main Program

SCREEN _NEWIMAGE(screen_width, screen_height, 7)

GOSUB ➔SetupMsg
GOSUB ➔SetupBackground
PCOPY (0, 71) - (1139, 143), 📄temp, 📄active

➔IterationStart:
    _delay 0.001
    SCROLL (0, 71) - (1139, 143), -5,0,TRUE
    SCROLL (0, 0) - (1139, 70), +15,0,TRUE
    SCROLL (0, 144) - (1139, 227), +15,0,TRUE
GOTO ➔IterationStart

' 🟠🟠🟠 Subroutines

➔SetupBackground:

    FOR z = 0 TO 4
      c = 1
      FOR i = 0 TO 227 STEP 10
          LINE (228*z,i) - (i+228*z,0), c
          LINE (228*(z+1),i) - (i + 228*z,227), c
          c = c + 1 : IF c = 16 THEN c = 1
      NEXT i
    NEXT z
    RETURN

➔SetupMsg:

    msg$ = "Howdy Doody ! "
    PRINT msg$
    FOR j = 0 TO 8
        LOCATE 10 + j, 1
            FOR k = 0 TO 8*LEN(msg$)
                IF POINT(k,j) = 0 THEN PRINT " "; ELSE PRINT "*";
            NEXT k
        PRINT
    NEXT j
    LOCATE 1,1 : PRINT SPACE$(70)
    PCOPY 📄active, 📄temp
    CLS
    RETURN